﻿using Microsoft.AspNetCore.Mvc;
using Missbot.MisskeyClient;

namespace Missbot.Admin.Controllers
{
    [Route("[controller]/[action]")]
    public class MisskeyClientController : APIBaseController
    {
        [HttpPost]
        public IActionResult AddClient(MisskeyClientMeta meta)
        {
            if (!meta.IsValid())
            {
                return new JsonResult(new {code = -1, msg = "param invalid."});
            }
            
            meta.Insert();
            return new JsonResult(new {code = 1});
        }
    }
}